home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / ImageWriter--Chooser snooper / ChooserSupport.r < prev    next >
Encoding:
Text File  |  1996-06-15  |  6.5 KB  |  252 lines  |  [TEXT/MPS ]

  1. /*
  2.     ChooserSupport.r -    other resources needed in order for driver to work
  3.                         with the Chooser.
  4.     
  5.     Copyright © 1992-1996 Apple Computer, Inc.
  6.     All rights reserved.
  7.  
  8.      6/14/96        cn                Updated to support Universal Interfaces 2.1.
  9.      8/26/94        dmh                Updated to 1.0.1 driver sources for SDK.
  10.      3/22/94        dmh                Updated for the b4 seed.
  11.     12/20/93        dmh                Sync'd with the shipping 1.0b3 GX driver.
  12. */
  13.  
  14. #include "Types.r"
  15. #include "SysTypes.r"
  16. #include "GXPrintingResTypes.r"
  17.  
  18. //--------------------------------------------------------------------------------------------
  19. // THINGS TO CONTROL THE DEFAULT CHOOSING MECHANSIM
  20. //--------------------------------------------------------------------------------------------
  21.  
  22. // what type of communication does this device use (this is the default, as the actual
  23. // value can be found in the desktop printer).
  24. resource 'look' (-4096, sysheap, purgeable) {
  25.     2,                // use the second in our list by default
  26.     
  27.     {
  28.     "AppleTalk",    -4096,        isAppleTalk,                "ImageWriter";
  29.     "Serial",        -4095,        iconCells,                    "Modem Port";
  30.     "Servers",        -4094,        isAppleTalk+isPrinterShare,    "ImageWriterIIIS";
  31.     };
  32. };
  33.  
  34.  
  35. resource 'comm' (-4096, sysheap, purgeable) {
  36.     PAP
  37.         {
  38.         1,
  39.         "",
  40.         0, 0, 0, 0
  41.         };
  42. };
  43.  
  44. resource 'comm' (-4095, sysheap, purgeable) {
  45.     Serial
  46.         {
  47.         baud9600,        /* Output baud rate */
  48.         noParity,        /* Output parity */
  49.         twoStop,        /* Output stop bits */
  50.         data8,            /* Output data size */
  51.         0xFFFF1113,        /* Output handshaking */
  52.         0x00000000,
  53.         baud9600,        /* Input baud rate */
  54.         noParity,        /* Input parity */
  55.         twoStop,        /* Input stop bits */
  56.         data8,            /* Input data bits */
  57.         0xFFFF1113,        /* Input handshaking */
  58.         0x00000000,
  59.         1024,            /* Input buffer size */
  60.         ".AIn",            /* Input driver name */
  61.         ".AOut"            /* Output driver name */
  62.         };
  63. };
  64.  
  65. resource 'comm' (-4094, sysheap, purgeable) {
  66.     PrinterShare
  67.         {
  68.         "",
  69.         0
  70.         };
  71. };
  72.  
  73.     
  74.  
  75. //--------------------------------------------------------------------------------------------
  76. // STANDARD CHOOSER PACK STUFF
  77. //--------------------------------------------------------------------------------------------
  78.  
  79. // NBP Lookup type (maxed out so resource file won't need updating)
  80. resource 'STR ' (-4096, sysheap, purgeable)
  81. {
  82.     "XXXXXXXXXXXXXXXXXXXXXX";
  83. };
  84.  
  85. // NBP timeout value
  86. type 'GNRL'
  87. {
  88.     byte;    // timeout
  89.     byte;    // retries
  90. };
  91.  
  92. resource 'GNRL' (-4096, sysheap, purgeable)
  93. {
  94.     11,
  95.     5
  96. };
  97.  
  98. // title string (we'll put a control here, so we don't want a title)
  99. resource 'STR ' (-4091, sysheap, purgeable)
  100. {
  101.     "";
  102. };
  103.  
  104. // "left" button title
  105. resource 'STR ' (-4093, sysheap, purgeable)
  106. {
  107.     "Create";
  108. };
  109.  
  110. // rectangle list
  111. resource 'nrct' (-4096, sysheap, purgeable) {
  112.     {
  113.     {112, 251, 132, 311};            // left button
  114.     {0,0,0,0};                        // right button
  115.     {-101, 180, -101+20, 400};        // on button (location of device list - popup is placed here)
  116.     {0,0,0,0};                        // off button
  117.     {0,0,0,0};                        // button label
  118.     };
  119. };
  120.  
  121. // Menu used to select between direct connect, AppleTalk, and Servers
  122. resource 'MENU' (-4096, sysheap, purgeable)
  123. {
  124.     -4096,
  125.     textMenuProc,
  126.     0xFFFFFFFF,    
  127.     enabled,
  128.     "",
  129.     {
  130.     }
  131. };
  132.  
  133. // Pop-up control used to select between direct connect printers and those being shared on the network
  134. resource 'CNTL' (-4096, sysheap, purgeable)
  135. {
  136.     {0, 0, 20, 213},                            // zero based control location
  137.     0,                                            // Title options 0 = Left justified
  138.     visible,                                    // Should we display the control?
  139.     95,                                            // Title Width
  140.     -4096,                                        // 'MENU' to display
  141.     popupMenuCDEFproc+popupFixedWidth,            // CDEF = CDEFID * 16 + varCode
  142.     0,                                             // refCon = ResType to append = None
  143.     "Connect via:"                                // Control title
  144. };
  145.  
  146. resource 'DITL' (-4096, sysheap, purgeable) 
  147. {
  148.     {
  149.         {3, 238, 23, 238 + 213}, 
  150.             Control {enabled, -4096},
  151.     };
  152. };
  153.  
  154. resource 'DITL' (-4095, sysheap, purgeable) {
  155.     {    /* array DITLarray: 2 elements */
  156.         /* [1] */
  157.         {143, 310, 163, 368},
  158.         Button {
  159.             enabled,
  160.             "OK"
  161.         },
  162.         /* [2] */
  163.         {23, 87, 119, 377},
  164.         StaticText {
  165.             disabled,
  166.             "This printer driver could not be used.\n\n"
  167.             "Quitting one or more applications and then "
  168.             "trying again may allow you to use this "
  169.             "printer driver."
  170.         }
  171.     }
  172. };
  173.  
  174. resource 'ALRT' (-4095, sysheap, purgeable) {
  175.     {30, 30, 30+175, 30+380},
  176.     -4095,
  177.     {    /* array: 4 elements */
  178.         /* [1] */
  179.         OK, visible, sound1,
  180.         /* [2] */
  181.         OK, visible, sound1,
  182.         /* [3] */
  183.         OK, visible, sound1,
  184.         /* [4] */
  185.         OK, visible, sound1
  186.     },
  187.     alertPositionParentWindowScreen
  188. };
  189.  
  190. //-----------------------------------------------------------------------------------
  191. // CHOOSER PACK HELP RESOURCES
  192. //-----------------------------------------------------------------------------------
  193.  
  194.  
  195. /*    Any Chooser package can get balloons on all items that are normally 
  196.     added to the Chooser dialog by containing a STR# resource of 
  197.     resource ID = PackResID (-5694) and following the convention below:
  198.         
  199.         resource 'STR#' (-5694, sysheap, purgeable) {
  200.           {        "kEnabledLeftButton";    // message for button (or control) that is Enabled but not checked
  201.                 "kDisabledLeftButton";    // message for the control that is Disabled
  202.                 "kCheckedLeftButton";    // message for the control that is Checked (ie CtrlValue>0)
  203.                 "kOtherLeftButton";        // message for the control that is Other (ie CtrlValue>1)
  204.                 "kEnabledRightButton";
  205.                 "kDisabledRightButton";
  206.                 "kCheckedRightButton";
  207.                 "kOtherRightButton";
  208.                 "kEnabledOnButton";
  209.                 "kDisabledOnButton";
  210.                 "kCheckedOnButton";
  211.                 "kOtherOnButton";
  212.                 "kEnabledOffButton";
  213.                 "kDisabledOffButton";
  214.                 "kCheckedOffButton";
  215.                 "kOtherOffButton";
  216.                 "kEnabledOnOffTitle";
  217.                 "kDisabledOnOffTitle";
  218.                 "kCheckedOnOffTitle";
  219.                 "kOtherOnOffTitle";
  220.           }
  221.         };
  222.         
  223.     This is a horrible Chooser hack for 7.0 - but we'll follow along in GX.
  224. */
  225.  
  226. resource 'STR#' (-5694, sysheap, purgeable) {
  227.   {        
  228.   
  229.           "Click here to create a desktop printer for the selected device."; // message for button (or control) that is Enabled but not checked
  230.         "You have not selected a device to create, or there is not enough memory to create a desktop printer at this time.";    // message for the control that is Disabled
  231.         "";    // message for the control that is Checked (ie CtrlValue>0)
  232.         "";    // message for the control that is Other (ie CtrlValue>1)
  233.         "";    // kEnabledRightButton
  234.         "";    // kDisabledRightButton
  235.         "";    // kCheckedRightButton
  236.         "";    // kOtherRightButton
  237.         "Use this pop–up menu to select the type of connection for the desktop printer you are creating.";
  238.         "";    // kDisabledOnButton
  239.         "";    // kCheckedOnButton 
  240.         "";    // kOtherOnButton
  241.         "";    // kEnabledOffButton
  242.         "";    // kDisabledOffButton
  243.         "";    // kCheckedOffButton
  244.         "";    // kOtherOffButton
  245.         "";    // kEnabledOnOffTitle
  246.         "";    // kDisabledOnOffTitle
  247.         "";    // kCheckedOnOffTitle
  248.         "";    // kOtherOnOffTitle
  249.   }
  250. };
  251.  
  252.